#ifndef SOCKCOMADT_H_
#define SOCKCOMADT_H_

typedef struct CommCDT * Comm;

typedef enum {COMM_CLIENT, COMM_SERVER} commType;
typedef enum {SERVER, CLIENT, BOTH} sockType;

Comm comm;

Comm initComm(commType type, char * host, char * port);
void send_packet(Comm comm, const void *p, int qty, int service );
int receive_packet(Comm comm, void *p, int lim, int service );
int receive_UDP(Comm comm, void *p, int lim );
void send_UDP(Comm comm, void * stream, int lim);
void closeComm(Comm comm, sockType sock);
int acceptComm(Comm comm);
//void closeSock(Comm comm, int serv);
int TCPechod(Comm comm);
char * printIP(Comm comm);
int sockSel(Comm comm);

#endif
